import React, { Component } from 'react';
import store from './redux/store';
import Test from './Test'

class App extends Component {
    state={
        isShow:store.getState().isShow
    }
    componentDidMount() {
        console.log('ok')
        store.subscribe(()=>{
            console.log('订阅',store.getState().isShow)
            this.setState({
                isShow:store.getState().isShow
            })
        })
    }
    
    render() {
        return (
            <div>
                {this.state.isShow && <span>哈哈哈哈</span>}
                <Test></Test>
            </div>
        );
    }
}

export default App;
